import { axios } from '../../utils/request'
export const baseAPI = {
  sparePartRecordChart: '/dm/spare/sparePartRecordChart', //备件大屏
  // queryMaintainChart:
  //   '/dm/maintain/queryMaintainChart?begintime=2022-10-25&endtime=2022-10-25', //维修大屏
  queryMaintainChart: '/dm/maintain/queryMaintainChart', //维修大屏
  queryProdChartDetail: '/dm/prod/queryProdChartDetail',
  queryProdChart: '/dm/prod/queryProdChart', //生产大屏
  queryBYCharts: '/dm/by/queryBYCharts', //保养大屏
  queryDataCommon: '/dm/machine/queryDataCommon?tablename=dm_machine', //博耐尔大屏
  produceDuringOneWeek: '/jlt/dataScreen/produceDuringOneWeek', //佳力图生产车间大屏

  keepPressureTable: '/mes/moorder/keepPressureTable', //佳力图生产车间大屏
  downExportFile: '/system/file/downExportFile',
  queryProdChartByInv: '/dm/prod/queryProdChartByInv',

  //旭川

  xcqueryDataCommon: '/mes/dataReport/queryDataCommon',
  //切换工厂打包

  // //博耐尔芜湖
  bnrQuery: '/barcode/system/common/query',
  sysQuery: '/barcode/system/common/query',
  //博耐尔安庆
  // bnrQuery: '/barcode_aq/system/common/query',
  // sysQuery: '/barcode_aq/system/common/query',
  //博耐尔大连
  // bnrQuery: '/barcode_dl/system/common/query',
  // sysQuery: '/barcode_dl/system/common/query',

  // 贝伦思接口
  blsQuery: '/barcode/system/common/query',
}

export function blsQuery(parameter) {
  return axios({
    url: baseAPI.blsQuery,
    method: 'post',
    data: parameter,
  })
}
export function sysQuery(parameter) {
  return axios({
    url: baseAPI.sysQuery,
    method: 'post',
    data: parameter,
  })
}
export function bnrQuery(parameter) {
  return axios({
    url: baseAPI.bnrQuery,
    method: 'post',
    data: parameter,
  })
}
export function queryProdChartByInv(parameter) {
  return axios({
    url: baseAPI.queryProdChartByInv + '?invcode=' + window.invcode,
    method: 'post',
    data: parameter,
  })
}
export function xcqueryDataCommon(a, b) {
  return axios({
    url: baseAPI.xcqueryDataCommon,
    method: 'post',
    params: { tablename: a, pageIndex: b },
    // data: parameter,
  })
}
export function keepPressureTable(parameter) {
  return axios({
    url: baseAPI.keepPressureTable,
    method: 'post',
    data: parameter,
  })
}
export function queryProdChartDetail(parameter) {
  return axios({
    url: baseAPI.queryProdChartDetail,
    method: 'post',
    data: parameter,
  })
}
export function queryDataCommon(parameter) {
  return axios({
    url: baseAPI.queryDataCommon,
    method: 'post',
    data: parameter,
  })
}
export function produceDuringOneWeek(parameter) {
  return axios({
    url: baseAPI.produceDuringOneWeek,
    method: 'post',
    data: parameter,
  })
}

export function queryBYCharts(parameter) {
  return axios({
    url: baseAPI.queryBYCharts,
    method: 'post',
    data: parameter,
  })
}
export function queryProdChart(parameter) {
  return axios({
    url: baseAPI.queryProdChart,
    method: 'post',
    data: parameter,
  })
}
export function queryMaintainChart(parameter) {
  return axios({
    url: baseAPI.queryMaintainChart + '?begin=2022-10-01&end=2022-10-30',
    method: 'post',
    data: parameter,
  })
}

export function sparePartRecordChart(parameter) {
  return axios({
    url: baseAPI.sparePartRecordChart,
    method: 'post',
    data: parameter,
  })
}
